<template>
  <div>
    <!-- 年度曲线 -->
    <div style="width: 100%; height: 650px" id="myChart"></div>
  </div>
</template>

<script>
export default {
  name: "profile",
  data() {
    return {
      msg: "Welcome to Your Vue.js App",
    };
  },
  mounted() {
    this.drawLine();
  },
  methods: {
    drawLine() {
      // 基于准备好的dom，初始化echarts实例
      let myChart = this.$echarts.init(document.getElementById("myChart"));
      // 绘制图表
      myChart.setOption({
        title: {
          text: "2021客户统计报表",
        },
        tooltip: {
          trigger: "axis",
        },
        legend: {
          data: ["新增客户", "跟单次数", "订单数量", "合同数量", "售后次数"],
        },
        grid: {
          left: "3%",
          right: "4%",
          bottom: "3%",
          containLabel: true,
        },
        toolbox: {
          feature: {
            saveAsImage: {},
          },
        },
        xAxis: {
          type: "category",
          boundaryGap: false,
          data: [
            "一月",
            "二月",
            "三月",
            "四月",
            "五月",
            "六月",
            "七月",
            "八月",
            "九月",
            "十月",
            "十一月",
            "十二月",
          ],
        },
        yAxis: {
          type: "value",
        },
        series: [
          {
            name: "新增客户",
            type: "line",
            stack: "Total",
            data: [120, 132, 101, 134, 90, 230, 210, 0, 0, 0, 0, 50],
          },
          {
            name: "跟单次数",
            type: "line",
            stack: "Total",
            data: [220, 182, 191, 234, 290, 330, 310, 0, 0, 0, 0, 50],
          },
          {
            name: "订单数量",
            type: "line",
            stack: "Total",
            data: [150, 232, 201, 154, 190, 330, 410, 0, 0, 0, 0, 50],
          },
          {
            name: "合同数量",
            type: "line",
            stack: "Total",
            data: [320, 332, 301, 334, 390, 330, 320, 0, 0, 0, 0, 50],
          },
          {
            name: "售后次数",
            type: "line",
            stack: "Total",
            data: [820, 932, 901, 934, 1290, 1330, 1320, 0, 0, 0, 0, 50],
          },
        ],
      });
    },
  },
};
</script>
<style lang="scss">

</style>